package com.erp.enums;

/**
 * @ClassName : OperationStatusEnum
 * @Description : 操作状态枚举类(1.草稿箱 2.待批箱 3.已批箱 4.完成箱 5.垃圾箱)
 * @Author : lst
 * @Date: 2020-07-01 18:38
 */
public enum OperationStatusEnum {

    /**
     * 草稿箱
     */
    DRAFT_BOX(1, "草稿箱"),

    /**
     * 待批箱
     */
    PENDING_BOX(2, "待批箱"),

    /**
     * 二级待批箱
     */
    SECONDARY_APPROVAL(21, "待批箱"),

    /**
     * 已批箱
     */
    APPROVED_BOX(3, "已批箱"),

    /**
     * 完成箱
     */
    COMPLETION_BOX(4, "完成箱"),

    /**
     * 垃圾箱
     */
    TRASH_CAN(5, "垃圾箱"),

    /**
     * 终止箱
     */
    TERMINATION_BOX(6, "终止箱");

    /**
     * id
     */
    private int id;

    /**
     * 描述
     */
    private String desc;

    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }

    OperationStatusEnum(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    /**
     * 通过id获取描述信息
     * @param id
     * @return
     */
    public static String getDescById(int id){
        for(OperationStatusEnum operationStatusEnum : OperationStatusEnum.values()){
            if(operationStatusEnum.getId() == id){
                return operationStatusEnum.getDesc();
            }
        }
        return "";
    }
}
